From 6ad1c8996461e47cb3b696e833397c4ac029c9ce Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 24 Feb 2004 00:07:15 +0000 Subject: [PATCH] Add a destroy implementation in order to set priv->cell_view to NULL Tue Feb 24 01:08:27 2004 Matthias Clasen * gtk/gtkcombobox.c: Add a destroy implementation in order to set priv->cell_view to NULL before finalize stumbles over the dangling pointer. This big array of pointers into the widget tree in GtkComboBoxPrivate is really fragile and should be cleaned up. --- ChangeLog | 8 ++++++++ ChangeLog.pre-2-10 | 8 ++++++++ ChangeLog.pre-2-4 | 8 ++++++++ ChangeLog.pre-2-6 | 8 ++++++++ ChangeLog.pre-2-8 | 8 ++++++++ gtk/gtkcombobox.c | 16 +++++++++++++++- 6 files changed, 55 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9d0f61c6aa..395e6b3d05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Tue Feb 24 01:08:27 2004 Matthias Clasen + + * gtk/gtkcombobox.c: Add a destroy implementation in order to + set priv->cell_view to NULL before finalize stumbles over the + dangling pointer. This big array of pointers into the widget + tree in GtkComboBoxPrivate is really fragile and should be + cleaned up. + Mon Feb 23 17:52:43 2004 Jonathan Blandford * gtk/gtkfilechooserdefault.c (main_paned_create): use a size diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 9d0f61c6aa..395e6b3d05 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +Tue Feb 24 01:08:27 2004 Matthias Clasen + + * gtk/gtkcombobox.c: Add a destroy implementation in order to + set priv->cell_view to NULL before finalize stumbles over the + dangling pointer. This big array of pointers into the widget + tree in GtkComboBoxPrivate is really fragile and should be + cleaned up. + Mon Feb 23 17:52:43 2004 Jonathan Blandford * gtk/gtkfilechooserdefault.c (main_paned_create): use a size diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 9d0f61c6aa..395e6b3d05 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +Tue Feb 24 01:08:27 2004 Matthias Clasen + + * gtk/gtkcombobox.c: Add a destroy implementation in order to + set priv->cell_view to NULL before finalize stumbles over the + dangling pointer. This big array of pointers into the widget + tree in GtkComboBoxPrivate is really fragile and should be + cleaned up. + Mon Feb 23 17:52:43 2004 Jonathan Blandford * gtk/gtkfilechooserdefault.c (main_paned_create): use a size diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 9d0f61c6aa..395e6b3d05 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +Tue Feb 24 01:08:27 2004 Matthias Clasen + + * gtk/gtkcombobox.c: Add a destroy implementation in order to + set priv->cell_view to NULL before finalize stumbles over the + dangling pointer. This big array of pointers into the widget + tree in GtkComboBoxPrivate is really fragile and should be + cleaned up. + Mon Feb 23 17:52:43 2004 Jonathan Blandford * gtk/gtkfilechooserdefault.c (main_paned_create): use a size diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 9d0f61c6aa..395e6b3d05 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +Tue Feb 24 01:08:27 2004 Matthias Clasen + + * gtk/gtkcombobox.c: Add a destroy implementation in order to + set priv->cell_view to NULL before finalize stumbles over the + dangling pointer. This big array of pointers into the widget + tree in GtkComboBoxPrivate is really fragile and should be + cleaned up. + Mon Feb 23 17:52:43 2004 Jonathan Blandford * gtk/gtkfilechooserdefault.c (main_paned_create): use a size diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 755159c6db..2a9dcec232 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -127,6 +127,8 @@ static guint combo_box_signals[LAST_SIGNAL] = {0,}; static void gtk_combo_box_class_init (GtkComboBoxClass *klass); static void gtk_combo_box_cell_layout_init (GtkCellLayoutIface *iface); static void gtk_combo_box_init (GtkComboBox *combo_box); +static void gtk_combo_box_finalize (GObject *object); +static void gtk_combo_box_destroy (GtkObject *object); static void gtk_combo_box_set_property (GObject *object, guint prop_id, @@ -136,7 +138,6 @@ static void gtk_combo_box_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *spec); -static void gtk_combo_box_finalize (GObject *object); static void gtk_combo_box_style_set (GtkWidget *widget, GtkStyle *previous_style, @@ -304,6 +305,7 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass) { GObjectClass *object_class; GtkBindingSet *binding_set; + GtkObjectClass *gtk_object_class; GtkContainerClass *container_class; GtkWidgetClass *widget_class; @@ -320,6 +322,9 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass) widget_class->scroll_event = gtk_combo_box_scroll_event; widget_class->mnemonic_activate = gtk_combo_box_mnemonic_activate; + gtk_object_class = (GtkObjectClass *)klass; + gtk_object_class->destroy = gtk_combo_box_destroy; + object_class = (GObjectClass *)klass; object_class->finalize = gtk_combo_box_finalize; object_class->set_property = gtk_combo_box_set_property; @@ -2932,6 +2937,15 @@ gtk_combo_box_mnemonic_activate (GtkWidget *widget, return TRUE; } +static void +gtk_combo_box_destroy (GtkObject *object) +{ + GtkComboBox *combo_box = GTK_COMBO_BOX (object); + + GTK_OBJECT_CLASS (parent_class)->destroy (object); + + combo_box->priv->cell_view = NULL; +} static void gtk_combo_box_finalize (GObject *object) -- 2.30.2